from flask import Flask, request, jsonify
from ocr import OCREngine
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
@app.route("/ocr_ticket",methods =["GET"])
def ocr_ticket():
    file_name = request.args.get('file_name')
    print(file_name)
    tFrome, tTo, tNumber = ocr.run(file_name)

    return jsonify({
        "我的学号：":"[7210764212]",
        "出发":tFrome,
        "到达":tTo,
        "车次":tNumber
    })
if __name__=="__main__":
    ocr = OCREngine("/home/linux_7210764212/linux_midterm/img")
    app.run(host='0.0.0.0',port ='8880')
